﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BUS;

namespace WebNhaXuatBan
{
    public partial class DangKy : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void dangKy_Click(object sender, EventArgs e)
        {
            try {
                TaiKhoanBUS tk = new TaiKhoanBUS();
                DTO.TaiKhoanDTO tkdto=new DTO.TaiKhoanDTO();
                tkdto.TenTaiKhoan=txtTenDangNhap.Text;
                tkdto.MatKhau=txtMatKhau.Text;
                tkdto.SoLanGiaoDichVoiCongTy=0;
                tkdto.SoLanThamGiaDauGia=0;
                tkdto.CauTraLoi=txtCauTraLoi.Text;
                tkdto.MaCauHoi=int.Parse(DropDownList1.SelectedValue.ToString());
                tkdto.DaXoa=false;
                tkdto.PhanQuyen=1;
                tkdto.Email = txtEmail.Text;
                tkdto.TenCongTy = txtDiachi.Text;
                tk.ThemTaiKhoan(tkdto);
                Session["TaiKhoan"] = tkdto;
                Response.Redirect("default.aspx");
            }
            catch (Exception ex)
            { 
            }
        }
    }
}